/*
 * @Author: zhang xinzheng
 * @Date: 2022-01-06 09:16:05
 * @LastEditors: zhang xinzheng
 * @LastEditTime: 2022-01-10 16:42:03
 * @Description: 
 * @FilePath: \college_project\report-service\src\Charts\index.ts
 */
import { DataSourceMgr } from "../dataSource/dataSource";
import AxisChart, { EAxisType, IAxiosChartOptions, IAxisChartConfig } from "./AxisChart";
// 环形配置
import CircleChart, { ICircleChartConfig, ICircleChartOptions } from './CircleChart'
import RadarChart, { IRadarChartConfig, IRadarChartOptions } from "./RadarChart";
import { EChartType, EAxisChartDimension, ChartTypeValue } from "../core/ChartType"
import { ChartConfigMgr, ChartIdMap } from "./Charts";
export {
    EAxisType,
    EAxisChartDimension,
    EChartType,
    ChartTypeValue,
    CircleChart,
    ICircleChartConfig,
    ICircleChartOptions,
    IAxiosChartOptions,
    IAxisChartConfig,
    RadarChart,
    IRadarChartConfig,
    ChartConfigMgr,
    ChartIdMap,
    IRadarChartOptions
};
export default function ChartCreater(config: { [key: string]: any }, dataSource: DataSourceMgr, id?: string) {
    if (config.chartType == EChartType.AxisChart) {
        return new AxisChart(config, dataSource, id)
    }
    if (config.chartType == EChartType.PieChart) {
        return new AxisChart(config, dataSource, id)
    }
    if (config.chartType == EChartType.RadarChart) {
        return new RadarChart(config, dataSource, id)
    }
    console.error("report-service,chartConfig:", config);
    throw new Error("chartType undefined:" + config);
}